<?php
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	$return['item']=$this->plugin_setting('setting');
	$return['item']['func1']="model('jy_163/set_data')->upnews($title,$content,$abstract,$save,$article_tag),$title 文章标题,$content 文章内容,$abstract 文章摘要,$save 0存草稿，1发布,$article_tag 文章分类名";
	$return['item']['func2']="cfc('jy_163')->video()";
	$return['item']['authurl']='https://mp.163.com/oauth2/authorize?client_id='.$return['item']['client_id'].'&response_type=code&redirect_uri='.$return['item']['redirect_uri'];
	$return['item']['redirect_uri']=custom_url('jy_163/getauth/',true);
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '参数设置',
		  'edits' => 
		  array (
		    array (
		      'title' => '参数设置',
		      'list' => 
		      array (
				array ('name' => 'redirect_uri','type' => 'copy','title' => '用户授权登录成功后跳转的url','help'=>'如果有需要，可以复制！'),
				array ('name' => 'client_id','type' => 'string','title' => '网易号client_key','help'=>'移步：https://open.mp.toutiao.com/ 创建应用--选择内容生产方'),
				array ('name' => 'client_secret','type' => 'string','title' => '网易号的密钥'),
				array ('name' => 'authurl','type' => 'href_url','read'=>1,'title' =>'获取AccessToken','btntitle'=>'点击授权','help'=>'上面网易号参数只有保存后，这里的授权地址才会更新！'),
				array ('name' => 'expire','type' => 'string','read'=>1,'show'=>array('expire >'=>0),'title' => 'AccessToken到期时间'),
				array ('name' => 'func1','type' => 'copy','title' => '图文发文方法为','help'=>'更多使用方法请参考官方文档：http://mp.163.com/developer.html#/documents'),
		      ),
		    ),
		  ),
	);
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();	
	$this->plugin_setting('setting',$postdata);
	exi('设置成功！');
}
?>